<!--污染防治设施台账-->
<template>
    <Layout>
        <Form ref="form1" :model="dataToQuery" :label-width="120">
            <Row class="query-form">
                <Col span="8">
                    <FormItem label="单位名称：" prop="order">
                        <cascader-dom class="query-form-el" ref='queryOrgCascader' @setOrgInfo='setQueryCompanyName'
                                      :orgTree="true"
                                      :setCurrentName="{label:dataToQuery.companyName,value:dataToQuery.companyId}"></cascader-dom>
                    </FormItem>
                </Col>
                <Col span="8">
                    <FormItem label='产污设施编号：' >
                        <Input class='query-form-el' placeholder="请填写产污设施编号" type='text'
                               v-model='dataToQuery.productFacilityNumber'></Input>
                    </FormItem>
                </Col>
                <Col span="8" v-if="!switchFlag">
                    <!--<Button @click="switchQuery(true)" class="ivu-btn-switch" type="text">展开∨</Button>-->
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button type="primary" class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
                <Col span="8" v-else>
                    <FormItem label='产污设施名称：' >
                        <Input class='query-form-el' placeholder="请填写产污设施名称" type='text'
                               v-model='dataToQuery.productFacilityName'></Input>
                    </FormItem>
                </Col>
            </Row>
            <Row v-show="switchFlag" class="query-form">

                <Col span="8" offset="16">
                    <Button @click="switchQuery(false)" class="ivu-btn-switch" type="text">收起∧</Button>
                    <Button @click="reset" class="ivu-btn-reset">重置</Button>
                    <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
                </Col>
            </Row>
            <Row class="query-form">
                <Col span="24">
                    <Button size="large" class="ivu-btn-add" icon="md-add" @click="addInfo">新增</Button>
                    <Button size="large" class="ivu-btn-add" icon="md-download" @click="downloadDescriptionExcel">导出模板</Button>
                    <Button size="large" class="ivu-btn-add" icon="md-cloud-upload" @click="beachUpload">批量导入</Button>
                    <download-button :api="exportUrl" :queryForm="dataToQuery" />
                    <!-- <Button type="primary" class="ivu-btn-add" icon="md-cloud-download" @click="exportFormSubmit">导出</Button> -->
                </Col>
            </Row>
        </Form>
        <Table ref='table' :height="tableHeight" no-data-text="没有查询到相关数据!" @on-selection-change='getSelectRows'
               :loading='pageStatus.loading'
               border :columns="columns1" :data="dataTable">
        </Table>
        <Row style="margin-right:10px;">
            <Col span="24">
                <Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize"
                      @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray"
                      show-total show-sizer show-elevator/>
            </Col>
        </Row>
        <Modal :title="this.getModalTitle('污染防治设施台账')" :transfer=false :mask-closable="false" v-model="dialogShow" v-if="dataToView && dialogShow" :width=800 :styles="{maxHeight:'700px'}" class-name='limit-height-dialog'>
            <Row>
                <Col span="24">
                    <Form ref="dialogForm" :class="mode === 'view'?'modal-view-detail':''" :show-message="false" :model="dataToView" :rules="mode === 'view'?{}:ruleCustom" :label-width="mode === 'view'?160:null" :label-position="mode === 'view'?'right':'top'">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='所属二级集团：' prop='belongOrgId'>
                                    <div v-if="mode === 'view'">{{ dataToView.belongOrgName }}</div>
                                    <!--<Input v-else class='query-form-el' placeholder="请填写所属二级集团" type='text' v-model='dataToView.belongOrgId'></Input>-->
                                    <Select v-else class='query-form-el' placeholder="集团名称"  v-model='dataToView.belongOrgId' label-in-value @on-change="belongChange">
                                        <Option v-for="item in twoLevel" :value="item.orgId" :key="item.orgId">{{item.orgName}}</Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='单位名称：' prop='companyId'>
                                    <div v-if="mode === 'view'">{{ dataToView.companyName }}</div>
                                    <!--<Input v-else class='query-form-el' placeholder="请填写单位名称" type='text' v-model='dataToView.companyId'></Input>-->
                                    <div v-else>
                                        <cascader-dom  v-if="show"  class='query-form-el' ref='orgCascader' @setOrgInfo='setCompanyId' @setOrgname="setCompanyName" :orgTree="true"
                                                       :currentOrgId="dataToView.companyId" :rootOrgId="dataToView.belongOrgId"
                                                       :setCurrentName="{label:dataToView.companyName,value:dataToView.companyId}" ></cascader-dom>
                                    </div>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='产污设施编号：' prop='productFacilityNumber'>
                                    <div v-if="mode === 'view'">{{ dataToView.productFacilityNumber }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写产污设施编号" type='text'
                                           v-model='dataToView.productFacilityNumber'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='产污设施名称：' prop='productFacilityName'>
                                    <div v-if="mode === 'view'">{{ dataToView.productFacilityName }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写产污设施名称" type='text'
                                           v-model='dataToView.productFacilityName'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='产污环节名称：' prop='productLinkName'>
                                    <div v-if="mode === 'view'">{{ dataToView.productLinkName }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写产污环节名称" type='text'
                                           v-model='dataToView.productLinkName'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='污染物种类：' prop='pollutantsType'>
                                    <div v-if="mode === 'view'">{{ dataToView.pollutantsType }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写污染物种类" type='text'
                                           v-model='dataToView.pollutantsType'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='排放形式：' prop='emissionForm'>
                                    <div v-if="mode === 'view'">{{ dataToView.emissionForm }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写排放形式" type='text'
                                           v-model='dataToView.emissionForm'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='污染防治设施编号：' prop='controlFacilityNumber'>
                                    <div v-if="mode === 'view'">{{ dataToView.controlFacilityNumber }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写污染防治设施编号" type='text'
                                           v-model='dataToView.controlFacilityNumber'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='污染防治设施名称：' prop='controlFacilityName'>
                                    <div v-if="mode === 'view'">{{ dataToView.controlFacilityName }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写污染防治设施名称" type='text'
                                           v-model='dataToView.controlFacilityName'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='污染防治设施工艺：' prop='controlFacilityTechnique'>
                                    <div v-if="mode === 'view'">{{ dataToView.controlFacilityTechnique }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写污染防治设施工艺" type='text'
                                           v-model='dataToView.controlFacilityTechnique'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='是否为可行技术：' prop='ifWorkableTechnology'>
                                    <div v-if="mode === 'view'">{{ dataToView.ifWorkableTechnology }}</div>
                                    <!--<Input v-else class='query-form-el' placeholder="请填写是否为可行技术" type='text' v-model='dataToView.ifWorkableTechnology'></Input>-->
                                    <Select v-else v-model='dataToView.ifWorkableTechnology' placeholder="请填写是否为可行技术" label-in-value class='query-form-el'>
                                        <Option value="是" lable="是">是</Option>
                                        <Option value="否" lable="否">否</Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='污染防治设施其他信息：' prop='controlFacilityOther'>
                                    <div v-if="mode === 'view'">{{ dataToView.controlFacilityOther }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写污染防治设施其他信息" type='textarea' :autosize="{minRows:2,maxRows:5}"
                                           v-model='dataToView.controlFacilityOther'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='有组织排放口编号：' prop='organizedDrainNumber'>
                                    <div v-if="mode === 'view'">{{ dataToView.organizedDrainNumber }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写有组织排放口编号" type='text'
                                           v-model='dataToView.organizedDrainNumber'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='有组织排放口名称：' prop='organizedDrainName'>
                                    <div v-if="mode === 'view'">{{ dataToView.organizedDrainName }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写有组织排放口名称" type='text'
                                           v-model='dataToView.organizedDrainName'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='排放口设施是否符合要求：' prop='outletFacilitiesIfQualified'>
                                    <div v-if="mode === 'view'">{{ dataToView.outletFacilitiesIfQualified }}</div>
                                    <!--<Input v-else class='query-form-el' placeholder="请填写排放口设施是否符合要求" type='text' v-model='dataToView.outletFacilitiesIfQualified'></Input>-->
                                    <Select v-else v-model='dataToView.outletFacilitiesIfQualified' placeholder="请填写排放口设施是否符合要求" label-in-value class='query-form-el'>
                                        <Option value="是" lable="是">是</Option>
                                        <Option value="否" lable="否">否</Option>
                                    </Select>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='排放口类型：' prop='outletFacilitiesType'>
                                    <div v-if="mode === 'view'">{{ dataToView.outletFacilitiesType }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写排放口类型" type='text'
                                           v-model='dataToView.outletFacilitiesType'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="23">
                                <FormItem label='其他信息：' prop='notes'>
                                    <div v-if="mode === 'view'">{{ dataToView.notes }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写其他信息" type='textarea' :autosize="{minRows:2,maxRows:5}"
                                           v-model='dataToView.notes'></Input>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='填报人：' prop='createUserName'>
                                    <div v-if="mode === 'view'">{{ dataToView.createUserName }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写填报人" type='text'
                                           readonly v-model='dataToView.createUserName'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11">
                                <FormItem label='填报时间：' prop='createDate'>
                                    <div v-if="mode === 'view'">{{ renderViewDate(dataToView.createDate) }}</div>
                                    <DatePicker v-else class="query-form-el" placeholder="请选择填报时间"
                                                readonly v-model='dataToView.createDate'></DatePicker>
                                </FormItem>
                            </Col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <Col span="11">
                                <FormItem label='填报人手机号：' prop='registrantPhone'>
                                    <div v-if="mode === 'view'">{{ dataToView.registrantPhone }}</div>
                                    <Input v-else class='query-form-el' placeholder="请填写填报人手机号" type='text'
                                           v-model='dataToView.registrantPhone'></Input>
                                </FormItem>
                            </Col>
                            <Col span="11"></Col>
                        </Row>

                    </Form>
                </Col>
            </Row>
            <div slot="footer">
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-save' @click="submit('dialogForm')">确定
                </Button>
                <Button v-if="mode != 'view'" type="primary" class='ivu-btn-cancel' @click="handleCancel">取消</Button>
                <Button v-if="mode === 'view'" class='ivu-btn-save' @click="dialogShow=false">关闭</Button>
            </div>
        </Modal>

        <Modal :mask-closable="false" :transfer=false  v-model="model3" :width=700 title="污染防治设施台账导入" @on-cancel="cancelMap">
            <Form  ref="map" :show-message="false" :model="map" label-position="top">
                <Row type="flex" justify="space-around" class="code-row-bg">
                    <Col span="23">
                        <FormItem  label="" prop="file">
                            <div>
                                <Upload ref="upload1"
                                        :before-upload="handleUpload "
                                        :format="['xlsx', 'xls']"
                                        accept=".xlsx, .xls"
                                        :max-size="10240"
                                        type="drag"
                                        :action="uploadUrl">
                                    <div style="padding: 10px">
                                        <Icon type="ios-cloud-upload" size="45" style="color: #3399ff"></Icon>
                                        <p>点击将文件拖拽到这里上传</p>
                                        <span style="font-size:8px;color: #797a64">仅支持上传单个excel </span>
                                    </div>
                                </Upload>
                            </div>
                            <div v-if="fileTrue">
                                <a>{{ map.file.name }}</a>
                                <Button type="text" icon="md-trash" @click="map.file = {},fileTrue = false" style="margin-left: 5px;margin-bottom: 3px"/>
                            </div>
                        </FormItem>
                    </Col>
                </Row>
            </Form>
            <div slot="footer">
                <Button type="primary" class='ivu-btn-save' :disabled="uploadDissabled" @click="submitFile('map')">确定</Button>
                <Button type="primary" class='ivu-btn-cancel' @click="cancelMap">取消</Button>
            </div>
        </Modal>

        <Modal title="导入详情" v-model="logInfoModel" :transfer=false :mask-closable="false">
            <Row type="flex" justify="space-around" class="code-row-bg">
                <Col span="23">
                    <div v-html="logInfo"></div>
                </Col>
            </Row>
            <div slot="footer">
                <Button type="primary" class='ivu-btn-cancel' @click="logInfoModel=false,logInfo=null">关闭</Button>
            </div>
        </Modal>
    </Layout>
</template>

<script>
    import {Api} from '@/api/index.js'
    import {formatDate} from '@/tools/index'
    var cascaderDom = () => import('@/components/cascader-dom.vue');
    import pageCommonFunction from '@/components/pageCommonFunction.js'
    import {sessionStorage, cookie} from '@/common/cacheUtils.js';

    export default {
        components: {cascaderDom},
        data() {
            return {
                ...this.createCommonDataField(),
                imgUrl: "",
                columns1: [
                    {title: '序号', width: 70, fixed: 'left', align: 'center', render: this.indexColumnsRender},
                    { key:'belongOrgName',title: '所属二级集团',  align: 'center', minWidth: 120, },
                    { key:'companyName',title: '单位名称',  align: 'center', minWidth: 120, },
                    {key: 'productFacilityNumber', title: '产污设施编号', align: 'center', minWidth: 120,},
                    {key: 'productFacilityName', title: '产污设施名称', align: 'center', minWidth: 120,},
                    {key: 'productLinkName', title: '产污环节名称', align: 'center', minWidth: 120,},
                    {key: 'pollutantsType', title: '污染物种类', align: 'center', minWidth: 120,tooltip:true},
                    {key: 'emissionForm', title: '排放形式', align: 'center', minWidth: 120,},
                    {title: '污染防治设施', align: 'center', children: [
                            {key: 'controlFacilityNumber', title: '污染防治设施编号', align: 'center', minWidth: 120,},
                            {key: 'controlFacilityName', title: '污染防治设施名称', align: 'center', minWidth: 120,},
                            {key: 'controlFacilityTechnique', title: '污染防治设施工艺', align: 'center', minWidth: 120,},
                            {key: 'ifWorkableTechnology', title: '是否为可行技术', align: 'center', minWidth: 120,},
                            {key: 'controlFacilityOther', title: '污染防治设施其他信息', align: 'center', minWidth: 120,tooltip:true},]},
                    {key: 'organizedDrainNumber', title: '有组织排放口编号', align: 'center', minWidth: 120,},
                    {key: 'organizedDrainName', title: '有组织排放口名称', align: 'center', minWidth: 120,},
                    {key: 'outletFacilitiesIfQualified', title: '排放口设施是否符合要求', align: 'center', minWidth: 120,},
                    {key: 'outletFacilitiesType', title: '排放口类型', align: 'center', minWidth: 120,},
                    {key: 'notes', title: '其他信息', align: 'center', minWidth: 120,tooltip:true},
                    // {key: 'createUserName', title: '填报人', align: 'center', minWidth: 120,},
                    {key: 'createDate', title: '填报时间', align: 'center', minWidth: 120,
                        render: (h,params)=>{return h('span',this.renderViewDate(params.row.createDate))}},
                    // {key: 'registrantPhone', title: '填报人手机号', align: 'center', minWidth: 120,},
                    this.getActionColumns(),
                ],
                ruleCustom: {
                    belongOrgId: [ { required: true, message: '请填写所属二级集团', trigger: 'change',}],
                    companyId: [ { required: true, message: '请填写单位名称', trigger: 'change',}],
                    productFacilityNumber: [{required: true, message: '请填写产污设施编号', trigger: 'change',}],
                    productFacilityName: [{required: true, message: '请填写产污设施名称', trigger: 'change',}],
                    productLinkName: [{required: true, message: '请填写产污环节名称', trigger: 'change',}],
                    pollutantsType: [{required: true, message: '请填写污染物种类', trigger: 'change',}],
                    emissionForm: [{required: true, message: '请填写排放形式', trigger: 'change',}],
                    controlFacilityNumber: [{required: true, message: '请填写污染防治设施编号', trigger: 'change',}],
                    controlFacilityName: [{required: true, message: '请填写污染防治设施名称', trigger: 'change',}],
                    controlFacilityTechnique: [{required: true, message: '请填写污染防治设施工艺', trigger: 'change',}],
                    ifWorkableTechnology: [{required: true, message: '请填写是否为可行技术', trigger: 'change',}],
                    controlFacilityOther: [{required: true, message: '请填写污染防治设施其他信息', trigger: 'change',}],
                    organizedDrainNumber: [{required: true, message: '请填写有组织排放口编号', trigger: 'change',}],
                    organizedDrainName: [{required: true, message: '请填写有组织排放口名称', trigger: 'change',}],
                    outletFacilitiesIfQualified: [{required: true, message: '请填写排放口设施是否符合要求', trigger: 'change',}],
                    outletFacilitiesType: [{required: true, message: '请填写排放口类型', trigger: 'change',}],
                    notes: [{required: true, message: '请填写其他信息', trigger: 'change',}],
                    createUserName: [{required: true, message: '请填写填报人', trigger: 'change',}],
                    createDate: [{required: true, message: '请填写填报时间', trigger: 'change', type: 'date'}],
                    registrantPhone: [{
                        validator: (rule, value, callback) => {
                            if (!(/^1[3456789]\d{9}$/.test(this.dataToView.registrantPhone))) {
                                callback(' ');
                                // this.$Message.error("请填写有效的的手机号")
                            } else {
                                callback()
                            }
                        },
                        required: true,
                        trigger: 'blur'
                    }],
                },
                tableHeight: 10,
                dictMap: {},
                punishment: false,
                penaltyAmount: true,
                // api
                queryUrl: Api.queryEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                exportUrl: Api.exportEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                deleteUrl: Api.deleteEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                getUrl: Api.getEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                updateUrl: Api.updateEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                saveUrl: Api.saveEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                uploadUrl: Api.uploadEnTable.replace('{{table}}', 'PollutionControlFacilities'),
                show:true,
                currentUser: JSON.parse(sessionStorage('userId').get('userId')),

                fileTrue: false,
                map:{},
                model3:false,
                uploadDissabled: false,
                logInfoModel:false,
                logInfo:null
            }
        },
        async mounted() {
            this.setTableHeight();
            this.selectSecGroupNames()
            this.query();
        },
        methods: {
            ...pageCommonFunction,

            submitFile(map){
                this.$refs[map].validate((valid) => {
                    if (valid) {
                        this.uploadDissabled = true
                        let formData = new FormData();
                        formData.append("file", this.map.file);
                        formData.append("createUserId", this.currentUser.userId);
                        formData.append("createOrgId", this.currentUser.orgInfo.orgId);
                        this.$http.post(this.uploadUrl, formData).then((res) => {
                            this.uploadDissabled = false
                            if (res.data.status == "200") {
                                // this.$Message.success("污染防治设施台账成功! 导入详情请查看控制台");
                                this.logInfoModel = true
                                this.logInfo = res.data.data
                                this.query()
                            } else {
                                this.$Message.error(res.data.msg);
                            }
                            this.map={}
                            this.fileTrue = false
                            this.model3=false
                        }).catch(e => {
                            console.log(e);
                            this.model3=false
                            this.map={}
                            this.uploadDissabled = false
                            this.$Message.error("导入失败！请检查导入文档的格式是否正确");
                        })
                    } else {
                        this.$Message.error('请填报完整!');
                    }
                })

            },
            handleUpload (file) {
                this.map.file = file;
                this.fileTrue = true
                return false;
            },
            cancelMap() {
                this.model3 = false
                this.fileTrue = false
                this.map ={}
            },
            beachUpload(){
                this.model3 = true
                this.fileTrue = false
                this.map ={}
            },
            downloadDescriptionExcel() {
                this.$http.get(Api.templateDownload+'6', {
                    responseType: 'blob'      //告诉服务器我们需要的响应格式
                }).then((res) => {
                    const aLink = document.createElement("a");
                    let blob = new Blob([res.data], {
                        type: res.bodyBlob.type      //将会被放入到blob中的数组内容的MIME类型
                    });
                    aLink.href = URL.createObjectURL(blob)
                    aLink.download = "污染防治设施台账模板.xlsx" //标题
                    aLink.click()
                    document.body.appendChild(aLink)
                })
            },

            selectSecGroupNames(){
                this.$http.get(Api.quqeryTwoOrgInfo).then(res => {
                    this.twoLevel=res.data.data
                }).catch(e => {
                })
            },
            belongChange(value) {
                this.$set(this.dataToView,'belongOrgId',value.value)
                this.$set(this.dataToView,'belongOrgName',value.label)
                this.dataToView.companyId = null
                this.dataToView.companyName = null
                this.$refs.orgCascader.resetCurrentOrg();
                this.show = false;
                setTimeout(() => {
                    this.show = true
                }, 0)
            },
            deleteData(params) {
                this.deleteDateAjax(params);
            },
            query() {
                // if(this.dataToQuery.eventTypeIdsArrays) {
                //     this.dataToQuery.eventTypeIds = this.arrayToInFormat(this.dataToQuery.eventTypeIdsArrays)
                // }
                // this.dataToQuery.orgId = this.currentUser.companyId;
                this.queryAjax();
            },

            submit(name) {
                this.submitAjax(name);
            },
            createEmptyDataToAdd() {
                return {
                    createDate: new Date(),
                    createUserId: this.currentUser.userId,
                    createUserName:this.currentUser.userName,
                    id:this.get_uuid(),
                    idFiles:[],
                }
            },
            // async afterDataToViewInit() {
            //     await this.getFiles('id');
            // },
        },
        watch: {},
    }
</script>

<style lang='css' scoped>
    .ivu-form-item {
        padding-right: 20px;
    }

    .query-form-el, .ivu-date-picker, .ivu-input-wrapper {
        width: 100%;
    }

</style>

